<template>
  <div>
    <!-- 三级分类导航 -->
    <TypeNav></TypeNav>
    <!-- 中间轮播图+右侧区域 -->
    <ListContainer></ListContainer>
      <!--今日推荐-->
    <Recommend></Recommend>
    <!-- 商品排行 -->
    <Rank></Rank>
     <!-- 猜你喜欢 -->
     <Like></Like>
     <!--楼层 将获取的floor数据传给子组件-->
     <Floor v-for="floor in floorsList" :key="floor.id" :floor=floor :cname="'floor-swiper'+floor.id" ></Floor>

     <!--商标-->
     <Brand></Brand>
  </div>
</template>

<script>
// 引入home中组件
// import TypeNav from './TypeNav'
import ListContainer from './ListContainer'
import Recommend from './Recommend'
import Rank from './Rank'
import Like from './Like'
import Floor from './Floor'
import Brand from './Brand'
import {mapState} from 'vuex'
  export default {
    name:'Home',
    components:{
      // TypeNav,
      ListContainer,
      Recommend,
      Rank,
      Like,
      Floor,
      Brand
    },
    mounted(){
      // 获取楼层数据
      this.$store.dispatch('home/getFloorsListData')
    },
    computed:{
      ...mapState('home',['floorsList'])
    }

  }
</script>

<style lang="less" scoped>

</style>